<?php

function smarty_function_jqueryvmenu($params, &$smarty)
{
	$content = $params['Content'];

	$out = '';

	$size = 1;
	
	$out .= "<ul>";
	foreach ($content as $item){
	
//	print "<pre>";	
//	print_r($item);	
//	print "</pre>";

		if ($item->property == 'public' && $item->parent == 0 ) {
			print "<li><a href=\"admin.php5?go=$item->id\">$item->value</a>&nbsp;</li>";
			$size++;
		}
	}
	
	$out .= "</ul>";
                            
	$out .= "<br /><br /><div id=\"panel1\">
                        <div class=\"hd\" style=\"font-size: x-small;\">добавить раздел</div>
                        <form  id=\"form_add_new\" action=\"admin.php5\">
                        <input type=\"hidden\" name=\"action\" value=\"addnew\">
                        <input type=\"hidden\" name=\"parent\" value=\"0\">
                        <input type=\"hidden\" name=\"sortorder\" value=\"$size\">
                        <input type=\"hidden\" name=\"type\" value=\"1\">
                        <div class=\"bd\" style=\"font-size: x-small;\">Название:<br /> <input type=\"text\" name=\"value\"></div>
                        <div class=\"ft\"><input type=\"submit\" value=\"Ok\">&nbsp;</div>
                        </form><br /><br />
                </div>";                        
       
	return $out;
} 
 
?>
